package com.zbf.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2021/6/1  11:57
 * 描述:
 */
@Configuration
public class MyWebConfigration implements WebMvcConfigurer {

    @Override
    public void addCorsMappings(CorsRegistry registry) {

        registry.addMapping("/**")
                .allowCredentials(true)
                .allowedOrigins("http://localhost:8888")
                .allowedMethods("*")
                .allowedHeaders("*")
                .maxAge(36000);
    }



}
